#include "BlockConstrainedProblem.hpp"

using namespace Ipopt;


bool BlockConstrainedProblem::get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
		Index& nnz_h_lag, IndexStyleEnum& index_style) {

	if (!get_nlp_info(n, m, nnz_jac_g, nnz_h_lag)) {
		assert(!"get_nlp_info not implemented in derived class");
	}
	index_style = TNLP::C_STYLE;

	return true;
}


bool BlockConstrainedProblem::get_bounds_info(Index n, Number* x_l, Number* x_u, Index m,
		Number* g_l, Number* g_u) {

	if (!get_bounds_info(m, g_l, g_u)) {
		assert(!"get_bounds_info not implemented in derived class");
	}

	for (int i = 0; i < n; ++i) {
		x_l[i] = -1e19;
		x_u[i] = 1e19;
	}

	return true;
}

bool BlockConstrainedProblem::get_starting_point(Index n, bool init_x, Number* x, bool init_z,
		Number* z_L, Number* z_U, Index m, bool init_lambda, Number* lambda) {
	assert(init_z == false);
	assert(init_lambda == false);

	if (init_x)
		return get_starting_point(n, x);
	return true;
}

bool BlockConstrainedProblem::eval_h(Index n, const Number* x, bool new_x,
		Number obj_factor, Index m, const Number* lambda, bool new_lambda,
		Index nele_hess, Index* iRow, Index* jCol, Number* values) {

	return false;
}


